package cn.kdyzm.twofa.config;

import cn.org.rapid_framework.freemarker.directive.BlockDirective;
import cn.org.rapid_framework.freemarker.directive.ExtendsDirective;
import cn.org.rapid_framework.freemarker.directive.OverrideDirective;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author kdyzm
 * @date 2025/6/13
 */
@Configuration
@AllArgsConstructor
public class FreeMarkerConfig {
    private final freemarker.template.Configuration configuration;

    @PostConstruct
    public void init() {
//        configuration.setSharedVariable(putDirective.getName(), putDirective);
//        configuration.setSharedVariable(blockDirective.getName(), blockDirective);
//        configuration.setSharedVariable(extendsDirective.getName(), extendsDirective);
        configuration.setSharedVariable("block", new BlockDirective());
        configuration.setSharedVariable("override", new OverrideDirective());
        configuration.setSharedVariable("extends", new ExtendsDirective());
    }
}
